package Demo1;

import java.util.concurrent.Callable;

//继承Animal这个抽象类
public class Cat extends Animal{

    //完成父类抽象方法的重写
    @Override
    protected String getName(String name) {
        this.name = name;
        return this.name;
    }

    @Override
    protected void printAge(int age) {
        this.age = age;
        System.out.println(this.age);
    }

    public static void main(String[] args) {
       //实例化对象
        Cat cat = new Cat();
        //调用方法
        String name = cat.getName("wwh");
        System.out.println("name = " + name);//输出名字
        System.out.print("age = ");
        cat.printAge(3);
    }
}
